#ifndef _MAN_MENU_H_
#define _MAN_MENU_H_

#include <string>
#include <vector>
#include <thread>
#include "stdio.h"
#include <iostream>
#include "common.hpp"

#define MANMAXLIST 100
#define MANNON 9999
#define MANPAS 0
#define MANERR 1
#define MANWAI 2
#define MAN_MENU_OP "  >>>>>>>>>>  [up/down: select test proj]  [q: quit]"


using namespace std;

struct _MenuList {
	int index;
	string name;
	int state;
};

struct MenuList {
	int count;
	int sel;
	_MenuList list[MANMAXLIST];
	
};

class ManMenu {
public:
	ManMenu(string path);
	~ManMenu();
	void loop();
	void setSel(int sel);
	void setState(int state);
	int getSel();
	string getName();
	void update();
private:
	static void threadFunc(ManMenu* ptr);
	MenuList m_list;
	thread m_thread;
	bool m_quit;
};

#endif
